﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Factorization
{
    class Program
    {
        static void Main(string[] args)
        {
            string input = Console.ReadLine().Trim();
            try
            {
                int n = int.Parse(input);
                var factors = Factorize(n);
                StringBuilder output = new StringBuilder();
                foreach(int i in factors)
                {
                    output.Append($"{i} ");
                }
                Console.WriteLine(output);
            }
            catch
            {
                Console.WriteLine("ERROR");
            }
            finally
            {
                Console.ReadKey();
            }
        }
        static List<int> Factorize(int n)
        {
            if (n <= 1) throw new ArgumentException();
            List<int> factors = new List<int>();
            for(int i = 2; n != 1; i++)
                if (n % i == 0)
                {
                    if (factors.Count == 0 || factors.Last() != i) factors.Add(i);
                    n /= i;
                    i--;
                }
            return factors;
        }
    }
}
